const path = require('path')
const Mock = require('./mock/index.js')

config = {
    devServer: {
        contentBase: path.join(__dirname, 'mock'),
        compress: true,
        port: 8080,
        overlay: {
            warnings: false,
            errors: true
        }
    }
}

if (process.env.MOCK === "true") {
    config.devServer.before = function(app) {
        Mock(app)
    }
}

module.exports = config